<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  

  
  <title>flask-数据库处理 | Huafeihua</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
  
  
  <meta name="description" content="##数据的增加，删除，修改数据库连接代码123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051#-*-coding:GBK -*-from flask import Flask, redirect, render_template , url_for from fla">
<meta name="keywords" content="flask">
<meta property="og:type" content="article">
<meta property="og:title" content="flask-数据库处理">
<meta property="og:url" content="http://malone00.gitee.io/huafeihua/2019/01/22/flask/Flask数据库处理/index.html">
<meta property="og:site_name" content="Huafeihua">
<meta property="og:description" content="##数据的增加，删除，修改数据库连接代码123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051#-*-coding:GBK -*-from flask import Flask, redirect, render_template , url_for from fla">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2019-01-22T08:27:18.567Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="flask-数据库处理">
<meta name="twitter:description" content="##数据的增加，删除，修改数据库连接代码123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051#-*-coding:GBK -*-from flask import Flask, redirect, render_template , url_for from fla">
  
    <link rel="alternate" href="/huafeihua/atom.xml" title="Huafeihua" type="application/atom+xml">
  
  
    <link rel="icon" href="/images/tmp.jpg">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/huafeihua/css/style.css">
  <link rel="stylesheet" href="/huafeihua/css/highlight.css">
</head>
</html>
<body>
  <div id="fullpage" class="mobile-nav-right">
    
      <div id="wrapper" title="图片来自网络">
    
    
      <header id="header">
  <div id="nav-toggle" class="nav-toggle"></div>
  <div class="head-box global-width">
    <nav class="nav-box nav-right">
      
        <a class="nav-item" href="/huafeihua/" title="">首页</a>
      
        <a class="nav-item" href="/huafeihua/categories" title="">分类</a>
      
        <a class="nav-item" href="/huafeihua/archives" title="">归档</a>
      
        <a class="nav-item" href="/huafeihua/tags" title="">标签</a>
      
        <a class="nav-item" href="/huafeihua/about" title="">关于</a>
      
    </nav>
  </div>
</header>
      <div id="middlecontent" title class="global-width sidebar-left">
        <section id="main"><article id="post-flask/Flask数据库处理" class="article global-container article-type-post" itemscope="" itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 class="article-title" itemprop="name">
      flask-数据库处理
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/huafeihua/2019/01/22/flask/Flask数据库处理/" class="article-date">
  <time datetime="2019-01-22T08:58:59.000Z" itemprop="datePublished">2019-01-22</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/huafeihua/categories/python/">python</a>
  </div>

    
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/huafeihua/tags/flask/">flask</a></li></ul>

  </div>
  
    <span id="busuanzi_container_page_pv">
      本文总阅读量<span id="busuanzi_value_page_pv"></span>次
    </span>
  

  <div class="article-inner">
    
    <div class="article-content article-content-doorframe" itemprop="articleBody">
      
        <p>##数据的增加，删除，修改<br>数据库连接代码<br><div class="highlight-box" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true" data-rel="PLAIN"><figure class="iseeu highlight /plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br></pre></td><td class="code"><pre><span class="line">#-*-coding:GBK -*-</span><br><span class="line">from flask import Flask, redirect, render_template , url_for </span><br><span class="line">from flask.globals import request</span><br><span class="line">from flask_bootstrap import Bootstrap</span><br><span class="line">from pip._vendor.html5lib.html5parser import method_decorator_metaclass</span><br><span class="line">from sqlalchemy.sql.sqltypes import Integer</span><br><span class="line"></span><br><span class="line">app = Flask(__name__)</span><br><span class="line">from sqlalchemy import Column,Table ,String, create_engine,MetaData</span><br><span class="line">from sqlalchemy.orm import sessionmaker, relationship</span><br><span class="line">from sqlalchemy import create_engine</span><br><span class="line">from sqlalchemy.ext.declarative import declarative_base</span><br><span class="line">from sqlalchemy.sql.schema import ForeignKey</span><br><span class="line">from random import randint</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">#创建对象的基类：</span><br><span class="line">BASE = declarative_base()</span><br><span class="line">engine = create_engine(&apos;sqlite:///table.db&apos;, echo=True)  #生产上关闭echo</span><br><span class="line"></span><br><span class="line">#创建表</span><br><span class="line">def init_db():</span><br><span class="line">    BASE.metadata.create_all(engine)</span><br><span class="line"></span><br><span class="line">#删除表</span><br><span class="line">def drop_db():</span><br><span class="line">    BASE.metadata.drop_all(engine)</span><br><span class="line">    </span><br><span class="line">class User(BASE):</span><br><span class="line">    __tablename__ = &apos;users&apos;</span><br><span class="line">    </span><br><span class="line">    id = Column(Integer, primary_key=True)</span><br><span class="line">    name = Column(String(20))</span><br><span class="line">    password = Column(String(124))</span><br><span class="line">    </span><br><span class="line">    #一对多 一个用户有多个书</span><br><span class="line">    books = relationship(&apos;Book&apos;)</span><br><span class="line">    </span><br><span class="line">class Book(BASE):</span><br><span class="line">    __tablename__ = &apos;book&apos;</span><br><span class="line">    id = Column(Integer,autoincrement=True,primary_key=True )</span><br><span class="line">    name = Column(String(100))</span><br><span class="line">    </span><br><span class="line">    #“多”的一方，通过外键关联到user表的</span><br><span class="line">    user_id = Column(String(20),ForeignKey(&apos;users.id&apos;))</span><br><span class="line">Session = sessionmaker(bind=engine, autocommit=False, autoflush=False)</span><br><span class="line">init_db()</span><br><span class="line"></span><br><span class="line">session = Session()</span><br><span class="line"></span><br><span class="line">user = session.query(User)</span><br></pre></td></tr></table></figure></div></p>
<p>###1. 增加</p>
<div class="highlight-box" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true" data-rel="PLAIN"><figure class="iseeu highlight /plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">@app.route(&apos;/hello/new&apos;,methods=[&apos;GET&apos;,&apos;POST&apos;])</span><br><span class="line">def create_new_item():</span><br><span class="line">    if request.method == &apos;POST&apos;:</span><br><span class="line">        if request.form.get(&apos;g_name&apos;):</span><br><span class="line">            p_name = request.form.get(&apos;g_name&apos;)</span><br><span class="line">            new_user = User(name=p_name,password=&apos;Pwd&apos;)</span><br><span class="line">            session.add(new_user)</span><br><span class="line">            session.commit()</span><br><span class="line">            return redirect(url_for(&apos;hello_world&apos;))</span><br><span class="line">    else:</span><br><span class="line">        return render_template(&apos;additem.html&apos;)</span><br></pre></td></tr></table></figure></div>
<p>addietm.html代码<br><div class="highlight-box" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true" data-rel="PLAIN"><figure class="iseeu highlight /plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">&#123;% extends &quot;testbase.html&quot; %&#125;</span><br><span class="line">&#123;% block title %&#125;Add a new item &#123;%  endblock %&#125;</span><br><span class="line">&#123;% block body %&#125;</span><br><span class="line">&lt;h1&gt;Hello&lt;/h1&gt;</span><br><span class="line">&lt;p&gt;Welcome to my program.&lt;/p&gt;</span><br><span class="line"></span><br><span class="line">&lt;form action=&apos;/hello/new&apos; method=&apos;post&apos;&gt;</span><br><span class="line">    &lt;input type=&apos;text&apos; name=&apos;g_name&apos;&gt;&lt;/input&gt;</span><br><span class="line">    &lt;button type=&apos;submit&apos;&gt;Add&lt;/button&gt;</span><br><span class="line">&lt;/form&gt;</span><br><span class="line"></span><br><span class="line">&#123;% endblock %&#125;</span><br></pre></td></tr></table></figure></div></p>
<p>###2. 修改数据<br><div class="highlight-box" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true" data-rel="PLAIN"><figure class="iseeu highlight /plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">@app.route(&apos;/hello#&lt;int:id&gt;&apos;,methods=[&apos;GET&apos;,&apos;POST&apos;])</span><br><span class="line">def edit_item(id):</span><br><span class="line">    user = session.query(User).filter(User.id==id).one()</span><br><span class="line">    if request.method ==&apos;POST&apos;:</span><br><span class="line">        if request.form.get(&apos;g_name&apos;):</span><br><span class="line">            </span><br><span class="line">            p_name = request.form[&apos;g_name&apos;]</span><br><span class="line">            </span><br><span class="line">            user.name = p_name</span><br><span class="line">            session.commit()</span><br><span class="line">            </span><br><span class="line">            return redirect(url_for(&apos;hello_world&apos;))</span><br><span class="line">        else:</span><br><span class="line">            pass #未收到参数值的处理</span><br><span class="line">            </span><br><span class="line">    else:</span><br><span class="line">        return render_template(&apos;edititem.html&apos;, s_name = user.name,id=id)</span><br></pre></td></tr></table></figure></div></p>
<p>edititem.html代码<br><div class="highlight-box" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true" data-rel="PLAIN"><figure class="iseeu highlight /plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#123;% extends &quot;testbase.html&quot; %&#125;</span><br><span class="line">&#123;% block title %&#125;Edit the item &#123;%  endblock %&#125;</span><br><span class="line">&#123;% block body %&#125;</span><br><span class="line">&lt;h1&gt;Hello&lt;/h1&gt;</span><br><span class="line">&lt;p&gt;Welcome to my program.&lt;/p&gt;</span><br><span class="line"></span><br><span class="line">&lt;form action=&apos;&#123;&#123;url_for(&apos;edit_item&apos;,id=id)&#125;&#125;&apos; method=&apos;post&apos;&gt;</span><br><span class="line">    &lt;p&gt;Name:&lt;/p&gt;</span><br><span class="line">    &lt;input type=&apos;text&apos; name=&apos;g_name&apos; placeholder=&apos;&#123;&#123; s_name &#125;&#125;&apos;&gt;&lt;/input&gt;</span><br><span class="line">    &lt;button type=&apos;submit&apos;&gt;Edit&lt;/button&gt;</span><br><span class="line">&lt;/form&gt;</span><br><span class="line">&lt;a href=&apos;&#123;&#123;url_for(&apos;hello_world&apos;)&#125;&#125;&apos;&gt;Canel&lt;/a&gt;</span><br><span class="line"></span><br><span class="line">&#123;% endblock %&#125;</span><br></pre></td></tr></table></figure></div></p>
<p>###3. 删除数据<br><div class="highlight-box" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true" data-rel="PLAIN"><figure class="iseeu highlight /plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">@app.route(&apos;/hello/&lt;int:id&gt;/delete&apos;,methods=[&apos;GET&apos;,&apos;POST&apos;])</span><br><span class="line">def del_item(id):</span><br><span class="line">    user = session.query(User).filter(User.id==id).one()</span><br><span class="line">    if request.method == &apos;POST&apos;:</span><br><span class="line">        session.query(User).filter(User.id==id).delete() #这里是物理删除，生产应该为逻辑删除，修改标志位</span><br><span class="line">        session.commit()</span><br><span class="line">        return redirect(url_for(&apos;hello_world&apos;))</span><br><span class="line">    else:</span><br><span class="line">        return render_template(&apos;deleteitem.html&apos;, id = id, s_name =user.name)</span><br></pre></td></tr></table></figure></div></p>
<p>deleteitem.html代码<br><div class="highlight-box" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true" data-rel="PLAIN"><figure class="iseeu highlight /plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">&lt;html&gt;</span><br><span class="line"></span><br><span class="line">&lt;body&gt;</span><br><span class="line">&lt;h1&gt; Are you sure you want to delete &#123;&#123;s_name&#125;&#125;? &lt;/h1&gt;</span><br><span class="line"></span><br><span class="line">&lt;form action=&quot;&#123;&#123; url_for(&apos;del_item&apos;,id = id)&#125;&#125;&quot; method = &apos;post&apos;&gt;</span><br><span class="line"></span><br><span class="line">&lt;input type=&apos;submit&apos; value = &apos;Delete&apos;&gt;</span><br><span class="line">&lt;/form&gt;</span><br><span class="line">&lt;a href = &quot;&#123;&#123; url_for(&apos;hello_world&apos;)&#125;&#125;&quot;&gt; Cancel &lt;/a&gt;</span><br><span class="line">&lt;/body&gt;</span><br><span class="line"></span><br><span class="line">&lt;/html</span><br></pre></td></tr></table></figure></div></p>

      
    </div>
    
      <footer class="article-footer">
        完
      </footer>
    
  </div>
  
    
<nav id="article-nav">
  <div class="article-nav-block">
    
      <a href="/huafeihua/2019/01/22/flask/jinja模板/" id="article-nav-newer" class="article-nav-link-wrap">
        <strong class="article-nav-caption"></strong>
        <div class="article-nav-title">
          
            flask-jinja模板
          
        </div>
      </a>
    
  </div>
  <div class="article-nav-block">
    
      <a href="/huafeihua/2019/01/22/flask/Flask-数据显示，jinja模板/" id="article-nav-older" class="article-nav-link-wrap">
        <div class="article-nav-title">flask-数据显示，jinja模板</div>
        <strong class="article-nav-caption"></strong>
      </a>
    
  </div>
</nav>

    
<div id="gitmentContainer"></div>
<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
<script>
var gitment = new Gitment({
  owner: 'malone00',
  repo: 'https://gitee.com/malone00/huafeihua.git',
  oauth: {
    client_id: '61b3470a9440579b58b3',
    client_secret: '889ecdcc18f7687dd9f5b36feb85080baf8a6c48',
  },
})
gitment.render('gitmentContainer')
</script>

  
  
</article>
</section>
        <aside id="sidebar">
  
    <div class="widget-box">
  <div class="avatar-box">
    <img class="avatar" src="/huafeihua/images/default-avatar.jpeg" title="图片来自网络">
    <h3 class="avatar-name">
      
        听风看雨
      
    </h3>
    <p class="avatar-slogan">
      抗揍的愤青，半个IT男。
    </p>
  </div>
</div>


  
    
  <div class="widget-box">
    <h3 class="widget-title">分类</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/huafeihua/categories/Linux/">Linux</a></li><li class="category-list-item"><a class="category-list-link" href="/huafeihua/categories/python/">python</a></li><li class="category-list-item"><a class="category-list-link" href="/huafeihua/categories/入坑/">入坑</a></li><li class="category-list-item"><a class="category-list-link" href="/huafeihua/categories/技巧/">技巧</a></li><li class="category-list-item"><a class="category-list-link" href="/huafeihua/categories/自动化/">自动化</a></li><li class="category-list-item"><a class="category-list-link" href="/huafeihua/categories/项目管理/">项目管理</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-box">
    <h3 class="widget-title">标签</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/Appium/">Appium</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/Docker/">Docker</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/Jenkins/">Jenkins</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/Nginx/">Nginx</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/Selenium/">Selenium</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/Ubuntu/">Ubuntu</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/centos/">centos</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/flask/">flask</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/python/">python</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/rabbit/">rabbit</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/sql/">sql</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/ubuntu/">ubuntu</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/效率/">效率</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/爬虫/">爬虫</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-box">
    <h3 class="widget-title">标签云</h3>
    <div class="widget tagcloud">
      <a href="/huafeihua/tags/Appium/" style="font-size: 10px;">Appium</a> <a href="/huafeihua/tags/Docker/" style="font-size: 13.33px;">Docker</a> <a href="/huafeihua/tags/Jenkins/" style="font-size: 10px;">Jenkins</a> <a href="/huafeihua/tags/Nginx/" style="font-size: 10px;">Nginx</a> <a href="/huafeihua/tags/Selenium/" style="font-size: 13.33px;">Selenium</a> <a href="/huafeihua/tags/Ubuntu/" style="font-size: 10px;">Ubuntu</a> <a href="/huafeihua/tags/centos/" style="font-size: 16.67px;">centos</a> <a href="/huafeihua/tags/flask/" style="font-size: 20px;">flask</a> <a href="/huafeihua/tags/python/" style="font-size: 20px;">python</a> <a href="/huafeihua/tags/rabbit/" style="font-size: 10px;">rabbit</a> <a href="/huafeihua/tags/sql/" style="font-size: 10px;">sql</a> <a href="/huafeihua/tags/ubuntu/" style="font-size: 10px;">ubuntu</a> <a href="/huafeihua/tags/效率/" style="font-size: 10px;">效率</a> <a href="/huafeihua/tags/爬虫/" style="font-size: 10px;">爬虫</a>
    </div>
  </div>

  
    
  <div class="widget-box">
    <h3 class="widget-title">归档</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/huafeihua/archives/2019/01/">一月 2019</a></li></ul>
    </div>
  </div>

  
    
  <div class="widget-box">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/huafeihua/2019/01/29/python-mq/">python rabbitmq</a>
          </li>
        
          <li>
            <a href="/huafeihua/2019/01/22/python/Unittest/">Python-Unittest</a>
          </li>
        
          <li>
            <a href="/huafeihua/2019/01/22/项目管理/项目管理2018-07-23/">U项目管理</a>
          </li>
        
          <li>
            <a href="/huafeihua/2019/01/22/随笔/-Kanboard-安装之Windows/">Kanboard 安装之Windows</a>
          </li>
        
          <li>
            <a href="/huafeihua/2019/01/22/运维部署/单网卡实现内外网访问/">单网卡实现内外网访问</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
      </div>
      <footer id="footer">
  <div class="foot-box global-width">
    &copy; 2019 Edwin Ma &nbsp;&nbsp;
    驱动于 <a href="http://hexo.io/" target="_blank">Hexo</a><br>
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span id="busuanzi_container_site_pv">阁下是第<span id="busuanzi_value_site_pv"></span>个访客</span>
  </div>
</footer>
      <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

<script src="/js/jquery-2.0.3.min.js"></script>

  <link rel="stylesheet" href="/huafeihua/fancybox/jquery.fancybox.css">
  <script src="/huafeihua/fancybox/jquery.fancybox.pack.js"></script>


<script src="/huafeihua/js/script.js"></script>



    </div>
    <nav id="mobile-nav" class="mobile-nav-box">
  <div class="mobile-nav-img mobile-nav-top"></div>
  
    <a href="/huafeihua/" class="mobile-nav-link">首页</a>
  
    <a href="/huafeihua/categories" class="mobile-nav-link">分类</a>
  
    <a href="/huafeihua/archives" class="mobile-nav-link">归档</a>
  
    <a href="/huafeihua/tags" class="mobile-nav-link">标签</a>
  
    <a href="/huafeihua/about" class="mobile-nav-link">关于</a>
  
  <div class="mobile-nav-img  mobile-nav-bottom"></div>
</nav>    
  </div>
</body>
</html>